Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/src/packages/next/pages/software/python/[name].tsx
Views: 687
/*1* This file is part of CoCalc: Copyright © 2021 Sagemath, Inc.2* License: MS-RSL – see LICENSE.md for details3*/45import { Alert, Layout } from "antd";67import { SoftwareEnvNames } from "@cocalc/util/consts/software-envs";8import Footer from "components/landing/footer";9import Head from "components/landing/head";10import Header from "components/landing/header";11import Image from "components/landing/image";12import SoftwareLibraries from "components/landing/software-libraries";13import { Paragraph, Title } from "components/misc";14import A from "components/misc/A";15import { Customize, CustomizeType } from "lib/customize";16import { ExecutableDescription } from "lib/landing/render-envs";17import { withCustomizedAndSoftwareSpec } from "lib/landing/software-specs";18import {19ComputeComponents,20ComputeInventory,21ExecInfo,22SoftwareSpec,23} from "lib/landing/types";24import { STYLE_PAGE, STYLE_PAGE_WIDE } from "..";25import pythonScreenshot from "/public/features/frame-editor-python.png";2627interface Props {28name: SoftwareEnvNames;29customize: CustomizeType;30spec: SoftwareSpec["python"];31inventory: ComputeInventory["python"];32components: ComputeComponents["python"];33execInfo?: ExecInfo;34timestamp: string;35}3637export default function Software(props: Props) {38const { name, customize, spec, inventory, components, execInfo, timestamp } =39props;4041function renderBox() {42return (43<Alert44style={{ margin: "15px 0" }}45message="Learn More"46description={47<span style={{ fontSize: "10pt" }}>48Learn more about{" "}49<strong>50<A href="/features/python">Python in CoCalc</A>51</strong>{" "}52and{" "}53<strong>54<A href="/features/jupyter-notebook">Jupyter Notebook support</A>55</strong>56.57</span>58}59type="info"60showIcon61/>62);63}6465function renderIntro() {66return (67<>68<Title level={1} style={{ textAlign: "center" }}>69Installed Python Libraries (Ubuntu {name})70</Title>71<div style={{ width: "50%", float: "right", padding: "0 0 15px 15px" }}>72<Image73src={pythonScreenshot}74alt="Writing and running a Python program"75/>76</div>77<Paragraph>78The table below lists pre-installed Python libraries for each79supported environment, which are immediately available in every CoCalc80project running on the default "Ubuntu {name}" image. If something is81missing, you can{" "}82<A href="https://doc.cocalc.com/howto/install-python-lib.html">83install it yourself84</A>85, or request that we install it.86</Paragraph>87</>88);89}9091// top part has the same with, the table is wider92function renderTop() {93return (94<div style={{ maxWidth: STYLE_PAGE.maxWidth, margin: "0 auto" }}>95{renderIntro()}96{renderBox()}97<h2 style={{ clear: "both" }}>Python Environments</h2>98<ExecutableDescription spec={spec} execInfo={execInfo} />99</div>100);101}102103return (104<Customize value={customize}>105<Head title="Python Libraries in CoCalc" />106<Layout>107<Header page="software" subPage="python" softwareEnv={name} />108<Layout.Content109style={{110backgroundColor: "white",111}}112>113<div style={STYLE_PAGE_WIDE}>114{renderTop()}115<SoftwareLibraries116spec={spec}117timestamp={timestamp}118inventory={inventory}119components={components}120libWidthPct={40}121/>122</div>123<Footer />124</Layout.Content>125</Layout>126</Customize>127);128}129130export async function getServerSideProps(context) {131return await withCustomizedAndSoftwareSpec(context, "python");132}133134135